﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;
using ValidationModule;

namespace TestingModule
{
    [TestFixture]
    public class ValidationModuleTests
    {
        [Test]
        public void TestCorrectUserName()
        {
            string test = "validname";
            Assert.AreEqual(true, FieldValidator.ValidUsername(test));
        }

        [Test]
        public void TestIncorrectName1()
        {
            string test = "invalidname*";
            Assert.AreEqual(false, FieldValidator.ValidUsername(test));
        }

        [Test]
        public void TestCNPCorrectValue()
        {
            string test = "1861029374553";
            Assert.AreEqual(true, FieldValidator.ValidCNP(test));
        }

        [Test]
        public void TestCNPIncorrectValue()
        {
            string test = "1861329374553";
            Assert.AreEqual(false, FieldValidator.ValidCNP(test));
        }

        [Test]
        public void TestCorrectEmailAddress()
        {
            string test = "test@test.com";
            Assert.AreEqual(true, FieldValidator.ValidEmail(test));
        }

        [Test]
        public void TestIncorrectEmailAddress()
        {
            string test = "test.test.com";
            Assert.AreEqual(false, FieldValidator.ValidEmail(test));
        }
    }
}
